package biz.ezcom.design.pattern.chainofresponsibility;

public class Client {
	public static void main(String[] args) {
		Manager gerneralManager = new ManagerGerneral();
		gerneralManager.setName("总经理");//总经理最大，没有他的管理者了
		
		Manager majorManager = new ManagerMajor();
		majorManager.setName("总监");
		majorManager.setManager(gerneralManager);//设置其管理者：总经理
		
		Manager projectManager = new ManagerProject();
		projectManager.setName("项目经理");
		projectManager.setManager(majorManager);//设置其管理者：总监
		
		Request request = new Request();
		request.setSalaryAdd(50);
		
		projectManager.handler(request);//加薪请求肯定先给其上一个管理者（projectManager）
		
		request.setSalaryAdd(500);
		projectManager.handler(request);
		
		request.setSalaryAdd(5000);
		projectManager.handler(request);
		
	}
}
